var timer =null
function initwesocket(){
	uni.connectSocket({
		url: 'ws://10.12.9.219:9092/business/socket/29682',
		success: (e)=> {},
		fail:(e)=>{
		},
	});
	uni.onSocketOpen(function (res) {
	  console.log('WebSocket连接已打开！');
	})
}
// initwesocket()
uni.onSocketError(function (res) {
	console.log('WebSocket连接失败，尝试重连')
	clearInterval(timer)
	timer=setInterval(()=>{
		initwesocket()
	},3000)
});
export{initwesocket}